﻿using System.Data;
using System.Windows.Forms;
using VMExplorer.MemoryObjects;

namespace VMExplorer.Forms
{
	partial class PropertyForm : Form
	{
		IMemoryObject _mo;
		public PropertyForm (IMemoryObject mo)
		{
			InitializeComponent ();
			_mo = mo;

			TabPage[] privateTabs = _mo.Tabs;
			if (privateTabs != null) this.tabControl.TabPages.AddRange (privateTabs);

			this.Text = string.Format("{0} Properties", _mo.Name);

			this._lblName.Text = _mo.Name;
			this._lblType.Text = _mo.Type.ToString();
			this._lblBaseAddress.Text = _mo.BaseAddress.ToString ();
			this._lblCommitted.Text = _mo.Stats.CommittedBytes.ToString ();
			this._lblReserved.Text = _mo.Stats.ReservedBytes.ToString ();
			this._lblTotal.Text = _mo.Stats.TotalBytes.ToString ();
			this._lblFragments.Text = _mo.Stats.Fragments.ToString ();

			this.propertyGrid1.SelectedObject = _mo.ViewableStruct;
		}
	}
}
